<?php
// $Id$

/**
 * Controller_Admin_Web 控制器
 */
class Controller_Admin_fxset extends Controller_Abstract {
	
	/**
	 * 分销设置
	 */
	function actionIndex()
	{
		if($this->_context->isPOST()){

	    	if($this->_context->id){
	    		$fxset = fxset::find(array("id"=>$this->_context->id))->getOne();
	    	}else{
	    		$fxset = new fxset();
	    	}
			$fxset->is_open=$this->_context->is_open;
			$fxset->fx_man=$this->_context->fx_man;
			$fxset->tx_money=floatval($this->_context->tx_money);
			$fxset->acct_id=$_SESSION['acct']['id'];
			$fxset->level=$this->_context->level;
			$fxset->bg_img=$this->_context->bg_img;
			$fxset->sysset=trim($this->_context->sysset);
			$fxset->save();

	        Syslog::logs ( '编辑分销信息,id :' . $fxset->id );
	        $this->_context->forwardUrl = url("fxset/index");
	        $this->success('设置成功');
	    }else{
	    	$fxset = fxset::find(array("acct_id"=>$_SESSION['acct']['id']))->getOne();
	    	$this->_view['info'] = $fxset;
	    }
	}



}


